-- GENERATED SPELL FOR [Infinite Chrono-Lord] --


function spell0_21697(pUnit, Event) --@Arcane Blast,n/a--
pUnit:FullCastSpellOnTarget(38538,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21697', 594, 1)
end

function spell1_21697(pUnit, Event) --@Arcane Discharge,Self--
pUnit:FullCastSpellOnTarget(38539,pUnit)
pUnit:RegisterEvent('Sorts_21697', 2000, 1)
end

function spell2_21697(pUnit, Event) --@Attraction,Self--
pUnit:FullCastSpellOnTarget(38540,pUnit)
pUnit:RegisterEvent('Sorts_21697', 689, 1)
end

function spell3_21697(pUnit, Event) --@Time Lapse,Self--
pUnit:FullCastSpellOnTarget(31467,pUnit)
pUnit:RegisterEvent('Sorts_21697', 10000, 1)
end

function Sorts_21697(pUnit, Event)
local choix_sorts_21697 = math.random(0, 3)
if choix_sorts_21697 == 0 then
pUnit:RegisterEvent('spell0_21697', 1, 1)
end
if choix_sorts_21697 == 1 then
pUnit:RegisterEvent('spell1_21697', 1, 1)
end
if choix_sorts_21697 == 2 then
pUnit:RegisterEvent('spell2_21697', 1, 1)
end
if choix_sorts_21697 == 3 then
pUnit:RegisterEvent('spell3_21697', 1, 1)
end
end

function mob21697_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21697', math.random(1500, 3000), 1)
end

function mob21697_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21697_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21697_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21697, 1, 'mob21697_Action')
RegisterUnitEvent(21697, 2, 'mob21697_Leave')
RegisterUnitEvent(21697, 3, 'mob21697_Kill')
RegisterUnitEvent(21697, 4, 'mob21697_Die')
